# Author: didiplus
# Date: 2025-01-22 10:02:26
# LastEditTime: 2025-01-22 15:52:01
# LastEditors: didiplus
# Description: 验证码功能主函数
# FilePath: \pythonscript\Captcha\Captcha.py


from utls import ArithmeticCaptcha














# 使用示例
if __name__ == "__main__":
    pass
    # 文本验证码示例
    # text_captcha = TextCaptcha(length=5, char_type=CaptchaBase.TYPE_ONLY_CHAR)
    # text_captcha.set_font(font_index=0, size=36)
    # text_captcha.generate()
    # image = text_captcha.create_image()
    # print("文本验证码:",text_captcha.get_text(),  "Base64:", text_captcha.save_image(image,"test.png"))

    # 算术验证码示例
    # arithmetic_captcha = ArithmeticCaptcha(width=150,length=3)
    # arithmetic_captcha.set_font(font_index=1, size=35)
    # arithmetic_captcha.generate()
    # image = arithmetic_captcha.create_image()
    # print("算术验证码 Base64:", arithmetic_captcha.save_image(image,'test.png'),arithmetic_captcha.get_text())

    # GIF 验证码示例
    # gif_captcha = GifCaptcha(length=4)
    # gif_captcha.set_font(font_index=2, size=36)
    # gif_captcha.generate()
    # print("文本验证码:",gif_captcha.get_text(),  "Base64:", gif_captcha.to_base64_gif())
    # print("GIF 验证码 Base64:", gif_captcha.to_base64_gif())
